'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  const apiV1Router = router.namespace('/api/v1')

  // 登录
  apiV1Router.post('/login', controller.user.user_login)

  // 获取权限
  apiV1Router.post('/user/auth', controller.user.user_auth)

  // 退出登录
  apiV1Router.post('/logout', controller.user.user_logout)

  // 用户列表
  apiV1Router.post('/user/list', controller.user.user_list)

  // 创建用户
  apiV1Router.post('/user/create', controller.user.user_create)

  // 编辑用户
  apiV1Router.post('/user/edit', controller.user.user_edit)

  // 删除用户
  apiV1Router.post('/user/delete', controller.user.user_delete)

  // 重置密码
  apiV1Router.post('/reset/password', controller.user.reset_password)

  // 用户列表
  apiV1Router.post('/role/list', controller.role.role_list)

  // 创建角色
  apiV1Router.post('/role/create', controller.role.role_create)

  // 菜单列表
  apiV1Router.post('/menu/list', controller.menu.menu_list)

  // 删除角色
  apiV1Router.post('/role/delete', controller.role.role_delete)

  // 编辑角色
  apiV1Router.post('/role/edit', controller.role.role_edit)

  // 创建菜单
  apiV1Router.post('/menu/create', controller.menu.menu_create)

  // 编辑菜单
  apiV1Router.post('/menu/edit', controller.menu.menu_edit)

  // 删除菜单
  apiV1Router.post('/menu/delete', controller.menu.menu_delete)



  // 获取文章列表
  apiV1Router.post('/article/list', controller.article.article_list)
  // 文章类型列表
  apiV1Router.post('/article/type/list', controller.article.article_type_list)
  // 根据ID查询详情
  apiV1Router.post('/article/detail', controller.article.article_detail)
  // 新增
  apiV1Router.post('/article/create', controller.article.article_create)
  // 导入
  apiV1Router.post('/article/create/all', controller.article.article_createAll)
  // 编辑内容
  apiV1Router.post('/article/edit', controller.article.article_edit)
  // 删除
  apiV1Router.post('/article/delete', controller.article.article_delete)

  // 公司列表
  apiV1Router.post('/company/list', controller.company.company_list)
  // 模糊查询期刊
  apiV1Router.post('/periodical/list', controller.periodical.periodical_list)

  // 使用数据类型列表
  apiV1Router.post('/article/data/type/list', controller.article.data_type_list)
  // 疾病子类列表
  apiV1Router.post('/article/disease/type/list', controller.article.disease_type_list)

  // 文章类型堆叠统计
  apiV1Router.post('/article/t1', controller.statistics.t1)
  // 公司得分堆叠统计
  apiV1Router.post('/article/t2', controller.statistics.t2)
};
